<html>
<head><meta charset="utf-8"><title>default LTO behavior · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/default.20LTO.20behavior.html">default LTO behavior</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="207791246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/default%20LTO%20behavior/near/207791246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Natalie Popescu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/default.20LTO.20behavior.html#207791246">(Aug 23 2020 at 21:03)</a>:</h4>
<p>what is rust's default LTO behavior when "embed-bitcode=no"? explicitly setting "LTO=off" seems to hurt performance in some cases, even though the docs claim that "embed-bitcode=no" is incompatible with any other LTO setting (and indeed rustc prevents you from specifying anything else).. is LTO still happening somewhere, i.e. the standard library or something?</p>



<a name="207791495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/default%20LTO%20behavior/near/207791495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/default.20LTO.20behavior.html#207791495">(Aug 23 2020 at 21:09)</a>:</h4>
<p>LTO doesn't happen at all unless <code>-Clto=yes</code>, <code>-Clto=fat</code>or <code>-Clto=thin</code> is used.</p>



<a name="207796154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/default%20LTO%20behavior/near/207796154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/default.20LTO.20behavior.html#207796154">(Aug 23 2020 at 23:21)</a>:</h4>
<p>Specifying <code>LTO=off</code> disables thin-local LTO (which is LTO across the crate's codegen units).</p>



<a name="207802687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/default%20LTO%20behavior/near/207802687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Natalie Popescu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/default.20LTO.20behavior.html#207802687">(Aug 24 2020 at 02:33)</a>:</h4>
<p><span class="user-mention" data-user-id="120518">@Eric Huss</span> i see! i've confirmed that there is now no observable difference between the two settings when i set "codegen-units=1" - thank you!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>